Skip to content

Fix purging HTTP cache for unreadable relations#3441

Merged
alanpoulain merged 2 commits into
api-platform:2.6from
julienfalque:fix-http-purge-unreadable-relation
Mar 9, 2021
Merged

Fix purging HTTP cache for unreadable relations#3441
alanpoulain merged 2 commits into
api-platform:2.6from
julienfalque:fix-http-purge-unreadable-relation

Conversation

@julienfalque

Copy link
Copy Markdown
Contributor
Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tickets -
License MIT
Doc PR -

When purging HTTP Cache Tags on Doctrine flush event, API Platform uses Doctrine mapping to determine the tags to purge. When doing so it assumes all mapped associations have a public accessor on the entity but sometimes this is not true and trying to access the value throws an exception.

I assume unreadable associations can be silently ignored as it means the associated entities don't appear in serialized responses which don't have the related tags anyway.

@julienfalque julienfalque force-pushed the fix-http-purge-unreadable-relation branch 2 times, most recently from 3e82053 to 6773a99 Compare March 13, 2020 15:18
@soyuka soyuka requested a review from dunglas March 16, 2020 10:10
@julienfalque julienfalque force-pushed the fix-http-purge-unreadable-relation branch from 6773a99 to f4f55a5 Compare April 24, 2020 08:31
@julienfalque julienfalque force-pushed the fix-http-purge-unreadable-relation branch from f4f55a5 to 433f2a4 Compare November 1, 2020 14:06
@alanpoulain alanpoulain changed the base branch from 2.5 to 2.6 March 4, 2021 16:23
@alanpoulain alanpoulain force-pushed the fix-http-purge-unreadable-relation branch from 433f2a4 to a744e18 Compare March 4, 2021 16:23

@alanpoulain alanpoulain left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alanpoulain alanpoulain force-pushed the fix-http-purge-unreadable-relation branch from a744e18 to 307f0a1 Compare March 9, 2021 10:27
@alanpoulain alanpoulain merged commit d362120 into api-platform:2.6 Mar 9, 2021
@alanpoulain

Copy link
Copy Markdown
Member

Thank you @julienfalque.

@julienfalque

Copy link
Copy Markdown
Contributor Author

Thank you @alanpoulain and @dunglas.

@julienfalque julienfalque deleted the fix-http-purge-unreadable-relation branch March 9, 2021 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants